package cn.zyq.demo.controller.wx.wx;

import cn.zyq.demo.service.wx.WxPayLogService;
import cn.zyq.demo.system.common.BaseController;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 微信支付调用流水
 * 2023-04-23 19:00:58
 */
@Slf4j
@Api(tags = "微信支付回调调")
@RestController(value = "WxPayLogController")
@RequestMapping(value = "/wx/pay")
public class WxPayLogController extends BaseController {

    @Resource
    private WxPayLogService wxPayLogService;

    /**
     * 微信付款成功或失败回调接口
     * <p>
     *
     * @param request  请求内容
     * @param response 响应内容
     * @return 操作结果
     */
    @PostMapping("notify")
    public Object payNotify(HttpServletRequest request, HttpServletResponse response) {
        log.info("【请求开始】微信付款成功或失败回调...");
        return wxPayLogService.payNotify(request, response);
    }
}

